﻿<Window x:Class="UnitFundProfitability.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Unit Funds Profitabilities" Height="600" Width="800">
    <Grid>
        <Grid.RowDefinitions>
        	<RowDefinition Height="*"/>
			<RowDefinition Height="4*"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>
		<Grid Grid.Row="0">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="*"/>
			</Grid.ColumnDefinitions>
			<StackPanel Grid.Column="0">
				<TextBlock Text="Start date" Margin="10,0"/>
				<DatePicker Name="StartDate" Margin="10,0"/>
			</StackPanel>
			<StackPanel Grid.Column="1">
				<TextBlock Text="End date" Margin="10,0"/>
				<DatePicker Name="EndDate" Margin="10,0"/>
			</StackPanel>
		</Grid>
		<DataGrid Grid.Row="1" Name="FundsProfitabilities" AutoGenerateColumns="False" IsReadOnly="True" ItemsSource="{Binding}">
			<DataGrid.Columns>
				<DataGridTextColumn Width="3*" Header="Unit fund" Binding="{Binding FundName}"/>
				<DataGridTextColumn Width="*" Header="Start value" Binding="{Binding StartValue, StringFormat='0.##'}">
					<DataGridTextColumn.ElementStyle>
						<Style TargetType="TextBlock">
							<Setter Property="HorizontalAlignment" Value="Right"/>
						</Style>
					</DataGridTextColumn.ElementStyle>			
				</DataGridTextColumn>
				<DataGridTextColumn Width="*" Header="Operations amount" Binding="{Binding OperationsAmount, StringFormat='0.##'}">
					<DataGridTextColumn.ElementStyle>
						<Style TargetType="TextBlock">
							<Setter Property="HorizontalAlignment" Value="Right"/>
						</Style>
					</DataGridTextColumn.ElementStyle>			
				</DataGridTextColumn>
				<DataGridTextColumn Width="*" Header="Expected end value" Binding="{Binding ExpectedEndValue, StringFormat='0.##'}">
					<DataGridTextColumn.ElementStyle>
						<Style TargetType="TextBlock">
							<Setter Property="HorizontalAlignment" Value="Right"/>
						</Style>
					</DataGridTextColumn.ElementStyle>			
				</DataGridTextColumn>
				<DataGridTextColumn Width="*" Header="End value" Binding="{Binding EndValue, StringFormat='0.##'}">
					<DataGridTextColumn.ElementStyle>
						<Style TargetType="TextBlock">
							<Setter Property="HorizontalAlignment" Value="Right"/>
						</Style>
					</DataGridTextColumn.ElementStyle>			
				</DataGridTextColumn>
				<DataGridTextColumn Width="*" Header="Profitability" Binding="{Binding Profitability, StringFormat='P'}">
					<DataGridTextColumn.ElementStyle>
						<Style TargetType="TextBlock">
							<Setter Property="HorizontalAlignment" Value="Right"/>
						</Style>
					</DataGridTextColumn.ElementStyle>			
				</DataGridTextColumn>
			</DataGrid.Columns>
		</DataGrid>
		<Grid Grid.Row="2">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="*"/>
			</Grid.ColumnDefinitions>
			<Button Grid.Column="0" Content="Add management company" Margin="10" Name="AddManagementCompany"/>
			<Button Grid.Column="1" Content="Add unit fund" Margin="10" Name="AddUnitFund"/>
			<Button Grid.Column="2" Content="Set markup rate" Margin="10" Name="SetMarkupRate"/>
			<Button Grid.Column="3" Content="Set markdown rate" Margin="10" Name="SetMarkdownRate"/>
			<Button Grid.Column="4" Content="Set price" Margin="10" Name="SetPrice"/>
			<Button Grid.Column="5" Content="Buy units" Margin="10" Name="BuyUnits"/>
			<Button Grid.Column="6" Content="Sell units" Margin="10" Name="SellUnits"/>
			<Button Grid.Column="7" Content="Move units" Margin="10" Name="MoveUnits"/>
		</Grid>
    </Grid>
</Window>
